<template>
  <div class="container">
    <div class="statistic">
      <p>汇聚 <span class="number">{{ totalDonors }}</span> 位爱心人士</p>
      <p>累计帮助 <span class="number">{{ helpedFamilies }}</span> 个家庭团聚</p>
    </div>
    <el-button
      class="publish-btn"
      type="danger"
      size="large"
      @click="redirectToCreateNotice"
    >
      立即发布寻人启事
      <el-icon class="icon-right"><Promotion /></el-icon>
    </el-button>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { useRouter } from 'vue-router'
import { Promotion } from '@element-plus/icons-vue'

const router = useRouter()
const totalDonors = ref('1,899,995')
const helpedFamilies = ref('25,400')

const redirectToCreateNotice = () => {
  router.push('/publish-search/create-notice')
}
</script>

<style scoped lang="scss">
.container {
  text-align: center;
  background-image: url('/img/immediatelybg.jpg');
  background-size: cover;
  background-position: center;
  height: 100%;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  min-height: 200px;
}

.statistic {
  margin-bottom: 20px;
  color: white;
  font-size: 24px;
  font-weight: bold;
}

.number {
  color: red;
}

.publish-btn {
  display: inline-block;
  padding: 10px 20px;
  background-color: #f35e5e;
  color: white;
  text-decoration: none;
  border-radius: 20px;
  font-size: 18px;
  font-weight: bold;

  &:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 68, 68, 0.4);
  }

  .icon-right {
    margin-left: 8px;
  }
}

@media (max-width: 1280px) {
  .container {
    min-height: 150px;
    padding: 10px;
  }

  .statistic {
    margin-bottom: 10px;
    font-size: 18px;
  }

  .publish-btn {
    padding: 8px 16px;
    font-size: 16px;
  }
}
</style>
